package com.zsn.demo.test;

/**
 * @author zsn
 * @CreateTime: 2022/11/11 0:36
 * @Description:
 */
public class MyThread implements Runnable{
    @Override
    public void run() {
        System.out.println("///////////");
    }

    static class TestForJoin implements Runnable{
        public static void main(String[] args) throws InterruptedException {
            Thread thread = new Thread(new TestForJoin());
            thread.start();
            for (int i = 0; i < 6; i++) {
                if(i==2){
                    thread.join();
                }
                System.out.println("main is running");
            }
        }

        @Override
        public void run() {
            for (int i = 0; i < 5; i++) {
                System.out.println("i am running");
            }
        }
    }
}

